#include <vector>
#include <fstream>
#include <iostream>
#include <QString>
#include <QDebug>

#include "libshapes.h"

using namespace std;

int main()
{
    Container c;
    ////TEST 1
    Shape* tmp;
    for (int i = 0; i < 15; i++) {
        int x = rand() % 3;
        if (x == 0) {
            tmp = new Square();
            tmp->figType = 'S';
            tmp->x = rand() % 10;
            tmp->y = rand() % 10;
            c.add(tmp);
        }
        if (x == 1) {
            tmp = new Rectangle();
            tmp->figType = 'R';
            tmp->x = rand() % 10;
            tmp->y = rand() % 10;
            c.add(tmp);

        }
        if (x == 2) {
            tmp = new Circle();
            tmp->figType = 'C';
            tmp->x = rand() % 10;;
            tmp->y = rand() % 10;;
            c.add(tmp);
        }

    }
    c.printShapesToFile("input");
    delete tmp;

    ///TEST2
    Container cont;
    cont.getDataFromFile("input.txt");

    for (int i = 0; i < cont.getSize(); i++) {
        cont.getShapeAt(i)->changePos(rand() % 100, rand() % 100);
    }
    cont.printShapesToFile("test22");

}
